package com.lanqiao.companymanage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lanqiao.companymanage.entity.User;
import io.swagger.models.auth.In;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper extends BaseMapper<User> {

    /**
     * 分页查询
     */
    Page<User> listPage(Page<User> userPage);

    /**
     * 根据员工编号(userId)查询
     * @param userId
     * @return
     */
    User selectUserByUserId(Integer userId);

    /**
     * 插入关联表
     * @param userId
     * @param depId
     * @return
     */
    int insertUser(Integer userId,Integer depId);

    /**
     * 删除关联表
     * @param userId
     */
    void deleteUserTea(Integer userId);

    /**
     * 查询全部员工信息
     * @return
     */
    List<User> getAllUser();
}
